package co.yixiang.modules.system.repository;

import co.yixiang.modules.system.domain.UserShop;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
* @author lijuhunze
* @date 2020-04-28
*/
public interface UserShopRepository extends JpaRepository<UserShop, Long>, JpaSpecificationExecutor<UserShop> {

    /**
     * 修改商户的用户id
     * @param id 用户名
     * @param uid 邮箱
     */
    @Modifying
    @Query(value = "update user_shop set uid = ?2 where id = ?1",nativeQuery = true)
    void updateUidById(long id, long uid);
}